#include "pickouttag.h"
#include <QDebug>

PickOutTag::PickOutTag()
{

}

QList<QDomNodeList> PickOutTag::FetchXMLDeviceNode(QByteArray text)
{
    QDomDocument doc;
    doc.setContent(text);
    QDomElement root = doc.documentElement();
    QList<QDomNodeList> deviceList ;

    //floor
    QDomNodeList nodes1 = root.childNodes();
    for(int i=0;i<nodes1.size();i++)
    {
        //Location
        QDomNodeList nodes2 = nodes1.at(i).childNodes();
        for(int j=0;j<nodes2.size();j++)
        {
            //Area
            QDomNodeList nodes3 = nodes2.at(j).childNodes();
            for(int k=0;k<nodes3.size();k++){
                QDomElement n = nodes3.at(k).toElement();
                qDebug() << "FetchXMLDeviceNode:" << n.tagName();

                deviceList.append(nodes3.at(k).childNodes());
            }
        }
    }

    return deviceList;
}
